// 引入jquery---------------
import $ from 'jquery';
window.$ = $;
window.jQuery = $;


//引入公共css
import '../css/common.scss';


// 封装promis AJAX请求-------------
export default function ajax({ url, type = 'GET', data = {} } = {}) {
    return new Promise((resolve, reject) => {
        $.ajax({
            url: 'http://localhost:3000' + url,
            data,
            type,
            success(res) {
                resolve(res);
            }
        })
    })
}